package org.jeecg.modules.qy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.collections.CollectionUtils;
import org.jeecg.modules.qy.service.IQyCommodityMarketingService;
import org.jeecg.modules.qy.entity.QyCommodityMarketing;
import org.jeecg.modules.qy.mapper.QyCommodityMarketingMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 商品营销表
 * @Author: jeecg-boot
 * @Date:   2021-03-12
 * @Version: V1.0
 */
@Service
public class QyCommodityMarketingServiceImpl extends ServiceImpl<QyCommodityMarketingMapper, QyCommodityMarketing> implements IQyCommodityMarketingService {


    public QyCommodityMarketing getByCommodityId(String commodityId){
        List<QyCommodityMarketing> list = list(new QueryWrapper<QyCommodityMarketing>().eq("commodity_id",commodityId));
        return CollectionUtils.isNotEmpty(list)?list.get(0):null;
    }
}
